import request from "./index";
import {AxiosResponse} from "axios";

function login(username: string, password: string): LoginResult {
    const data = {
        username, password
    }
    //                                            去掉await
    const res: AxiosResponse<LoginResult> = await request("/login", data)
    // 要去掉这个data
    return res.data
}

type LoginResult = {
    avatarUrl: string,

    token: string
}